<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/white/common/common.jsp"%>
<%@include file="/white/common/taglibs.jsp"%>
<html>
<head>
<script type="text/javascript">
        
        function submitForm(){
            var searchForm=document.getElementById("searchForm");
            searchForm.submit();
        }
        
        function notAllowedLockSelf(id){           
            var searchForm=document.getElementById("searchForm");
            searchForm.action="userAction-"+id+"!lock.action";
            searchForm.submit();            
        }
        
        function validateModify(){        	
        	var check = document.getElementsByName("selectedIds");
        	var a = 0;
            var id;
           
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a++;
                    id = check[i].value;
                }
            }
            
            if(a == 1){            	
            	var searchForm=document.getElementById("searchForm");
            	searchForm.action="taO2oChannelDayAction-"+id+"!toEdit.action";
            	searchForm.submit();
                return true;
            }else{
                alert("请�?择一条记�?");
                return false;
            }
        }        
        
        function validateDelete(){
            var check=document.getElementsByName("selectedIds");
            var a=false;
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a=true;
                    break;
                }
            }
            if(a){
                return confirm('你确定所�?');
            }else{
                alert("请先择你要删除的内容!!");
                return false;
            }
        }

        function doDelete(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='taO2oChannelDayAction!delete.action';
            searchForm.submit();
            return true;
        }
        
        function displayResult(){
            var result = "<s:property value='result'/>";
            if(result != null && result != ""){
                alert(result);
            }
        }    
        function excel() {
			var searchForm = document.getElementById("searchForm");
			searchForm.action = 'taO2oChannelDayAction!exportExcel.action';
			searchForm.submit();
		}
    </script>
</head>
<body onload="displayResult()">
	<s:form method="post" action="taO2oChannelDayAction!queryByPage.action"
		theme="simple" id="searchForm">
		<div id="div_title">
			<h3>
				O2O服务分渠道统计
			</h3>
			<div id="div_search">
				<table>
					<tr>
						<!-- 查询条件 -->
						<td width="40" align="right">
							日期：
						</td>
						<td>
							<s:textfield name="query_dayId" label="日期" size="8" maxlength="10"
							onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyyMMdd', minDate:'1900-01-01',maxDate:'',startDate:'%y-%M-{%d-1}'})">
							</s:textfield>
							-	
							<s:textfield name="query_etlTime" label="日期" size="8" maxlength="10"
							onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyyMMdd', minDate:'1990-01-01',maxDate:'',startDate:'%y-%M-{%d-1}'})">
							</s:textfield>
						</td>
						<td width="60" align="right">
							渠道:
						</td>
						<td>
							<s:select list="TaO2oChlIdMap" headerKey="" headerValue="-全部-"
							name="query_channelNo" id="query_channelNo" value="query_channelNo">
							</s:select>
						</td>
						
						<td width="80" align="right">
							<authz:authorize ifAnyGranted="SMOOTH_ALL">
								<s:submit cssClass="submit_search" value="搜索"
									action="taO2oChannelDayAction!queryByPage" />
							</authz:authorize>
						</td>
						<td width="70" align="right">
							<authz:authorize ifAnyGranted="OMC_NSP_LOG_COUNT">
								<input type="button" cssClass="input_button" value="导出"
										onClick="excel();document.getElementById('searchForm').action= 'taO2oChannelDayAction!queryByPage.action';"/>
							</authz:authorize>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<%-- <div id="div_button">
			<authz:authorize ifAnyGranted="SMOOTH_ALL">
				<s:submit value="新增"
					onclick="form.action='taO2oChannelDayAction!toAdd.action';return true;"
					cssClass="input_button" />
			</authz:authorize>
			<authz:authorize ifAnyGranted="SMOOTH_ALL">
				<s:submit value="修改" onclick="return validateModify()"
					cssClass="input_button" />
			</authz:authorize>
			<authz:authorize ifAnyGranted="SMOOTH_ALL">
				<input type="button" value="删除"
					onclick="if(validateDelete()){doDelete()}" class="input_button">
			</authz:authorize>
			<%@include file="/white/common/message.jsp"%>
		</div> --%>
		<!--列表 �?�� -->
		<table cellpadding="0" cellspacing="0" class="t_list">
			<tr>
				<!--列表头部 -->
				<th style="border-right: #DC2913 1px solid;">
					日期
				</th>
				<th style="border-right: #DC2913 1px solid;">
					渠道编号
				</th>
				<th style="border-right: #DC2913 1px solid;">
					渠道名称
				</th>
				<th style="border-right: #DC2913 1px solid;">
					UV（昨日）imei
				</th>
				<th style="border-right: #DC2913 1px solid;">
					UV（今日） imei
				</th>
				<th style="border-right: #DC2913 1px solid;">
					PV（昨日）请求数
				</th>
				<th style="border-right: #DC2913 1px solid;">
					PV（今日） 请求数
				</th>
				<th style="border-right: #DC2913 1px solid;">
					累计Uv
				</th>
				<th style="border-right: #DC2913 1px solid;">
					累计Pv
				</th>
			</tr>
			<!-- 用于遍历集合    -->
			<s:iterator value="resultList" status="sindex">
				<tr>
						<td>
							<s:property value="DAY_ID" />
						</td>
						<td>
							<s:property value="CHANNEL_NO" />
						</td>
						<td>
						  <s:property value="CHANNEL_NAME" />
						</td>
						<td>
						<s:if test='YES_UV == null'>-</s:if>
							<s:else>
								<s:property value="YES_UV" />
							</s:else>
						</td>
						<td>
						<s:if test='UV == null'>-</s:if>
							<s:else>
								<s:property value="UV" />
							</s:else>
						</td>
						<td >
						<s:if test='YES_PV == null'>-</s:if>
							<s:else>
								<s:property value="YES_PV" />
							</s:else>
						</td>
						<td>
							<s:if test='PV == null'>-</s:if>
							<s:else>
								<s:property value="PV" />
							</s:else>
						</td>
						<td>
							<s:if test='TOTAL_UV == null'>-</s:if>
							<s:else>
								<s:property value="TOTAL_UV" />
							</s:else>
						</td>
						<td  >
							<s:if test='TOTAL_PV == null'>-</s:if>
							<s:else>
								<s:property value="TOTAL_PV" />
							</s:else>
						</td>
				</tr>
			</s:iterator>
		</table>
		<!--列表 结束 -->
		<!--分页 �?�� -->
		<s:if test="resultList.size() > 0">
			<table border="0" cellspacing="0" cellpadding="0" class="t_bottom">
				<tr>
					<td><%@include file="/white/common/pageList.jsp"%></td>
				</tr>
			</table>
		</s:if>
		<!--分页 结束 -->

	</s:form>
</body>
</html>
